import com.nf.Student;
import util.ConnManager;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class UserDaoImpl implements UserDao {
    @Override
    public boolean deleteStudentById(int id) {
        boolean flag=false;
        try {
            Connection coon= ConnManager.getConnection();
            String sql="delete from student where id=?";
            PreparedStatement pst=coon.prepareStatement(sql);
            pst.setInt(1,id);
            pst.execute();
            flag=true;
            pst.close();
            coon.close();

        } catch (Exception e) {
            System.out.println("捕获删除错误 "+e.getMessage());
        }
        return flag;
    }

    @Override
    public boolean addStudent(entity student) {
        boolean flag=false;
        try {
            Connection conn=ConnManager.getConnection();
            
        } catch (Exception e) {
            System.out.println("捕获添加数据异常 "+e.getMessage());
        }


        return flag;
    }
}
